<template>
	<view class="content">
		
		<view class="mix-list-cell" :style="{background:background}" :class="border" @click="eventClick" hover-class="cell-hover"  :hover-stay-time="50">
			<text
				v-if="icon"
				class="cell-icon yticon"
				:style="[{
					color: iconColor,
				}]"
				:class="icon"
			></text>
			<image v-if="left_image" :src="left_image" class="left-image"></image>
			<text class="cell-tit clamp" v-if="diy_image" style="padding-left: 8px;">{{title}}</text>
			<text class="cell-tit clamp" v-else>{{title}}</text>
			<text v-if="tips" class="cell-tip">{{tips}}</text>
			<text v-if="t_status" style="border: 1px solid #59AA31;border-radius: 6rpx;color:#59AA31;height: 42rpx;line-height: 36rpx;font-size:24rpx;width: 100rpx;text-align: center">{{t_status}}</text>
			<text v-if="money" style="margin-left: 20rpx;font-size: 24rpx;">{{money}}</text>
			<input v-if="inputs" type="text" :maxlength="maxLength"  class="input-text" :value="inputs" />
			<text v-if="show_icon" class="cell-more yticon"	:class="typeList[navigateType]"	></text>
		</view>

	</view>
</template>
 
<script>
	/**
	 *  简单封装了下， 应用范围比较狭窄，可以在此基础上进行扩展使用
	 *  比如加入image， iconSize可控等
	 */
	export default {
		data() {
			return {
				typeList: {
					left: 'icon-zuo',
					right: 'icon-you',
					up: 'icon-shang',
					down: 'icon-xia'
				},
				
			}
		},
		props: {
			icon: {
				type: String,
				default: ''
			},
			title: {
				type: String | null,
				default: '标题'
			},
			tips: {
				type: String,
				default: ''
			},
			t_status:{
				type:String,
				default:''
			},
			money:{
				type:String,
				default:''
			},
			navigateType: {
				type: String,
				default: 'right'
			},
			border: {
				type: String,
				// default: 'b-b',
				default: ''
			},
			hoverClass: {
				type: String,
				default: 'cell-hover'
			},
			iconColor: {
				type: String,
				default: '#333'
			},
			diy_image:{
				type:Boolean,
				default:false
			},
			inputs:{
				type:String,
				default:''
			},
			left_image:{
				type:String,
				default:''
			},
			maxLength:{
				type:Number,
				default:15
			},
			show_icon:{
				type:Boolean,
				default:true
			},
			background:{
				type:String,
				default:''
			}
		},
		
		methods: {
			eventClick(){
				this.$emit('eventClick');
			},
			
		},
	}
</script>

<style lang='scss'>

	.icon .mix-list-cell.b-b:after{
		left: 90upx;
	}
	.mix-list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30upx;
		}

		.cell-icon{
			align-self:center;
			width:56upx;
			max-height:60upx;
			font-size:38upx;
		}
		.cell-more{
			align-self: center;
			font-size:30upx;
			color:$font-color-base;
			margin-left:$uni-spacing-row-sm;
		}
		.cell-tit{
			flex: 1;
			font-size: $font-base;
			color: #3D592F;
			font-weight: 400;
			
			font-style: normal;
			margin-right:10upx;
		}
		.cell-tip{
			font-size: $font-sm+2upx;
			color: $font-color-light;
		}
		.input-text{
			text-align: right;
		}
		.left-image{
			width: 40rpx;
			height: 40rpx;
			border-radius: 50%;
		}
		
	}
</style>
